#ifndef FILTERS_H_INCLUDED
#define FILTERS_H_INCLUDED

#include <math.h>
#include "pixelMap.h"

#define PERIODIC_NOISE_OP_ADD    0x55
#define PERIODIC_NOISE_OP_REMOVE 0x56

using namespace std;

typedef struct _COMPLEX
{
     double real;
     double imag;
     double module;
}COMPLEX;

double getModule( COMPLEX comp );
double getGreaterModule( void );

/** Noises */
void saltPepperNoise( pixel** matrix, int height, int width, float rate );
void customNoise( pixel** matrix, int height, int width, float rate );
void periodicNoise( COMPLEX** matrix, int height, int width, int x, int y, float radius, int operation );

/** Fast Fourier Transform */
int Powerof2( int nx, int *m, int *twopm );
int FFT2D( COMPLEX** matrixIn, COMPLEX** matrixOut, int nx, int ny, int dir );
int FFT( int dir, int m, double *x, double *y );

#endif // FILTERS_H_INCLUDED
